<?php
//
// test HTTP POST submitter, using libcurl
//
include_once "config.php";
include_once "common.php";


$auth =  $_COOKIE[$th_auth];
$username = $_COOKIE[$th_username];


$status = $_POST["collect_status"];
//$status = 'wish';
$rating = $_POST["rating"];
//$rating = '1';
$subject_id = $_POST["subject_id"];
//$subject_id = '10261';


if ($auth && !empty($auth) && $username && !empty($username) && $status && !empty($status)){

	$action_url = 'http://api.bgm.tv/collection/'.$subject_id.'/update?source='.$source;
	//$action_url = $action_url.'?source='.$source;

	$post_data = array ( 'status' => ($status),'rating' => ($rating),'auth' => ($auth));


	$update = curl_post($action_url, $post_data);



	returnError($update);




	print $update;
	


}
else{
printError();
}





?>